/*
 * @Description: 
 * @Version: 1.0
 * @Author: wenbin
 * @Date: 2021-05-19 11:44:20
 * @LastEditors: wenbin
 * @LastEditTime: 2021-06-23 10:04:12
 * @FilePath: /magus-plugin/examples/api/equipment.js
 * Copyright (C) 2021 wenbin. All rights reserved.
 */
const MAGUS_MBOXMS_API = process.env.VUE_APP_MAGUS_MBOXMS_API;
const MAGUS_EQUIPMENT_API = process.env.VUE_APP_MAGUS_EQUIPMENT_API;

const EQUIPMENT_API = {
  // 设备层级列表
  getEquipmentGroup: `${MAGUS_MBOXMS_API}/group`,
  // 新增层级
  addEquipmentGroup: `${MAGUS_MBOXMS_API}/group`,
  // 通过id修改层级列表
  putEquipmentGroup: (id) => {
    return `${MAGUS_MBOXMS_API}/group/${id}`
  },
  // 通过id修改层级列表
  deleteEquipmentGroup: (id) => {
    return `${MAGUS_MBOXMS_API}/group/${id}`
  },
  // 获取设备树
  getEquipmentInfoTree: `${MAGUS_MBOXMS_API}/info/tree`,
  // 获取设备树节点
  getEquipmentInfoTreeNode: `${MAGUS_MBOXMS_API}/info/nodes`,
  // 新增设备树节点
  addEquipmentInfoTreeNode: `${MAGUS_MBOXMS_API}/info`,
  // 编辑设备树节点
  getEquipmentInfoById:(id)  => `${MAGUS_MBOXMS_API}/info/${id}`,
  // 修改设备树节点
  putEquipmentInfoTreeNode:(id)  => `${MAGUS_MBOXMS_API}/info/${id}`,
  // 删除设备树节点
  deleteEquipmentInfoTreeNode:(id)  => `${MAGUS_MBOXMS_API}/info/${id}`,
  // 获取设备节点
  getEquipmentPoint: `${MAGUS_MBOXMS_API}/point`,
  // 设备节点归属
  getEquipmentNodeFrom: (id) => `${MAGUS_MBOXMS_API}/info/${id}/belong`,
  // 设备下关联的网关
  getEquipmentGateways: (id) => `${MAGUS_MBOXMS_API}/info/${id}/gateways`,
  // 测点删除
  deleteEquipmentPoint: (id) => `${MAGUS_MBOXMS_API}/point/${id}`,
  // 测点批量删除
  deleteEquipmentPoints: `${MAGUS_MBOXMS_API}/point`,
  // 获取测点信息
  getEquipmentPointInfo: (id) => `${MAGUS_MBOXMS_API}/point/${id}`,
  // 设备批量上传
  getEquipmentInfoMoreAdd: `${window.location.origin}${MAGUS_MBOXMS_API}/info/file`,
  // 设备数量
  getEquipmentInfoNum: `${MAGUS_MBOXMS_API}/info/count`,
  // 编辑节点信息
  putEquipmentPointInfo: (id) => `${MAGUS_MBOXMS_API}/point/${id}`,
  // 测点导入
  importEquipmentPoint: `${MAGUS_MBOXMS_API}/point/file`,
  // 测点导入
  exportEquipmentPoint: (datas) => `${window.location.origin}${MAGUS_MBOXMS_API}/point/file?equipmentId=${datas.equipmentId}&sendStatus=${datas.sendStatus}&content=${datas.content}`,
  // 图片上传
  uploadImage: (id) => `${MAGUS_EQUIPMENT_API}/templates/fileupload/${id}`,
  // 图片预览
  getImageUrl: `${MAGUS_EQUIPMENT_API}/templates/fileDownload`,
}

export default EQUIPMENT_API;